package com.gwtcx.client.util;

import com.google.gwt.core.client.GWT;
import com.gwtcx.client.i18n.GwtCxConstants;
import com.gwtcx.client.i18n.GwtCxMessages;

public class I18nUtil {

	  private static boolean initialised = false;

	  private static GwtCxConstants constants = null;
	  private static GwtCxMessages messages = null;

	  /**
	   * Initialise gwt-cx i18n.
	   */
	  public static void init() {

	    if (! initialised) {
	      constants = (GwtCxConstants) GWT.create(GwtCxConstants.class);
	      messages = (GwtCxMessages) GWT.create(GwtCxMessages.class);

	      initialised = true;
	    }
	  }

	  public static GwtCxConstants getConstant() {
	    return constants;
	  }

	  public static GwtCxMessages getMessage() {
	    return messages;
	  }
	}
